function sendRequest() {
  // Content-Type: application/x-www-form-urlencoded
  const data = encodeURI('name=张智琦&age=18') // name=%E5%BC%A0%E6%99%BA%E7%90%A6&age=18

  const xhr = new XMLHttpRequest()
  xhr.open('POST', 'http://127.0.0.1/api/post/x-www-form-urlencoded')
  xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
  xhr.onreadystatechange = () => {
    if (xhr.readyState === XMLHttpRequest.DONE) {
      if (xhr.status === 200) {
        const res = xhr.response
        console.log(res)
      }
    }
  }
  xhr.send(data)
}
